package leetcode.a_总结分布;

import java.lang.annotation.*;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

/**
 * {@link Code13_旋转数组问题}
 * <p>
 * <p>
 * {@link leetcode.pre50.Code34_FindNumInSortArray}
 * {@link leetcode.pre50.Code35_InsertIndex_插入位置}
 *
 * {@link leetcode.pre100.Code69_Sqrt_平方根}
 * {@link leetcode.pre100.Code69_Sqrt2}
 * @date 2020/6/2 22:36
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@interface A{
    int value();
}
public class Code14_二分查找问题_HalfSearch {

    @A(1)
    public void test1(){

    }

    public void test2(){

    }
    public static void main(String[] args)throws Exception {
        Code14_二分查找问题_HalfSearch search = new Code14_二分查找问题_HalfSearch();
        Class<? extends Code14_二分查找问题_HalfSearch> clazz = search.getClass();

        for (Method declaredMethod : clazz.getDeclaredMethods()) {
            declaredMethod.setAccessible(true);
            for (Annotation annotation : declaredMethod.getDeclaredAnnotations()) {
                if(annotation != null && annotation instanceof A){
                    System.out.println(((A) annotation).value());
                }
            }
        }
    }
}
